package com.example.coursaccino;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class StudentMainPage extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
    	System.out.println("Thing");
    	
        super.onCreate(savedInstanceState);
        setContentView(R.layout.student_main);
        
        Toast msg = Toast.makeText(getBaseContext(),"You have entered StudentMainPage", Toast.LENGTH_LONG);
    	msg.show();
        
        // If 'Browse Courses' button is clicked
        Button browseButton = (Button) this.findViewById(R.id.browseButton);
        browseButton.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
            	Toast msg = Toast.makeText(getBaseContext(),"You have clicked Button 1", Toast.LENGTH_LONG);
            	msg.show();
                Intent openNewPage = new Intent(StudentMainPage.this, StudentBrowsePage.class); 
                StudentMainPage.this.startActivity(openNewPage); 
            }
        });
        
     // If 'View My Courses' button is clicked
        Button viewButton = (Button) this.findViewById(R.id.viewButton);
        viewButton.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
            	//Toast msg = Toast.makeText(getBaseContext(),"You have clicked Button 2", Toast.LENGTH_LONG);
            	//msg.show();
                Intent openNewPage = new Intent(StudentMainPage.this, StudentViewPage.class); 
                StudentMainPage.this.startActivity(openNewPage); 
            }
        });
        
     // If 'View My Schedule' button is clicked
        Button scheduleButton = (Button) this.findViewById(R.id.scheduleButton);
        scheduleButton.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
            	//Toast msg = Toast.makeText(getBaseContext(),"You have clicked Button 3", Toast.LENGTH_LONG);
            	//msg.show();
                Intent openNewPage = new Intent(StudentMainPage.this, StudentBrowsePage.class); 
                StudentMainPage.this.startActivity(openNewPage); 
            }
        });
        
     // If 'View Friend's Courses' button is clicked
        Button friendsButton = (Button) this.findViewById(R.id.friendsButton);
        friendsButton.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
            	//Toast msg = Toast.makeText(getBaseContext(),"You have clicked Button 4", Toast.LENGTH_LONG);
            	//msg.show();
                Intent openNewPage = new Intent(StudentMainPage.this, StudentBrowsePage.class); 
                StudentMainPage.this.startActivity(openNewPage); 
            }
        });
    }

//    @Override
//    public boolean onCreateOptionsMenu(Menu menu) {
//        getMenuInflater().inflate(R.menu.activity_main, menu);
//        return true;
//    }

}
